package com.lyrpx.mapper;
import com.lyrpx.pojo.User;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

public interface UserMapper {
    @Select("select * from tb_user where id=#{id}")
    @Results({@Result(property = "id",column = "id",id = true),
            @Result(property = "username",column = "username"),
            @Result(property = "address",column = "address"),
            @Result(property = "ordersList",column = "id",many = @Many(select = "com.lnny.mapper.OrdersMapper.findByUserId"))
    })
    User findOrdersById(int id);
}
